<?php
//curl封装	
    function curl($url,$data = null){
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_URL, $url);
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
        if (!empty($data)){//post方式
            curl_setopt($curl, CURLOPT_POST, 1);
            curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
        }
        //获取采集结果
        $output = curl_exec($curl);
        //关闭cURL链接
        curl_close($curl);
        return $output;
    }

    $urljson =curl('http://red.000642.com/admin/public/index.php/api/luodi/urls');
    $luodiurl = json_decode($urljson,true)['url'];
    header("Location:".$luodiurl);